from flask import jsonify, request, Flask
from jsonrpc import dispatcher, JSONRPCResponseManager

app = Flask(__name__)


class Entrance:

    @staticmethod
    @app.route('/rpc', methods=['POST'])
    def gateway():
        response = JSONRPCResponseManager.handle(request.data, dispatcher)
        return jsonify(response.result)
